package com.ruoyi.repay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "9021000137679963";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCV7K7D+9Oy/7w7/uTe94itmSHppvLnzm7HOdsHArSHKHBL/2IwS+t4Yrg/ii7oFnZnVZaqPeBgY/ZQQBUOx1PYNFsiUlEJO18JC6QMJSSsapUAFSc4+P0JrkssTQu1WKEXRdIhvcBogYXOGh5bhXIdHi8yALFgT8DwFRYjygoVemLkOem4qWZvDRCckjXWVKp4aevTGtvYknbhLpcHcQXJv9/JgBAdxazXgzUli0nZElYqLDdRZjJKdZ7Xew8U4oeu6SvCvj/pZr7aqKshYfT3SgHtV2jWR7JeS3KLv4e0N64AsSW/7bNBRpoxO/VAZgsnceRgolIjxM8lhHWnnYt/AgMBAAECggEAIyZDbxVqc6v7cMF43UGBnNmrFsGab3h5hmHtFP6wXoO/mEG+vn3+LdJPSi5WgvlJNz7cvPsW0OJ+zB/KEBXxdV4JA8nyz8xIorFE+8f1iirO1h8fe/78LDndy/wgQ5sM4YzwEBMRui6rtT9wYJqvv13lSL7a1y67mE4JS8jBhnk4CHqr74dvXBzjENOmlxUfzHpNQeJmbpxlr85LeT8s/M24qmq5sbAGnWxG2ujEMf2UP3MZ47rEq36yHkAwaX8gA+iq8iU3Ka7LUxdlmPI+NQGGbDPYnJHp/VySB432aXdsnei0L2d7gi1qWgKOHezDd8fMjjhR7LVwaUws0voakQKBgQDROn/JzJ580N6V2kQnnbjw7Zn/4UFNlddhgc/D9uwABfJUoUR5WBqZKOUWcoy6h4P0/YWNM0n5Sboesmxheb5hDVoIr+u9X43miUDwUSJkyKSCtMzEahZoJcOMgEJv8lZdqqSBS+l4XpM4z9qSDrnzaT5R2AavXzLo5R2pMV0RtwKBgQC3cGaPyEPHfI4YbdqRzKXwqgzjukYMZxrp+7hGJsBmN5Y0KqAe/NJXpwnhVS5kfJAGa47d2oVyy9w2iUlIBxSY8X0HVe5cxOUsl6uYnm8P1iV7QpExeENf7QNEww/2U+bpHTqtA+iXKUMoeaQHxAsSa0Hg+XTlYQeTZkvOMTE0eQKBgE5bekA5QaG9F59Hfv7XMswIMASEd9B2rZL26riZYQkhMQBA5UQMmumBR0qA2/N/jQvTZpDbBHk4A1w7thtLXOE7/twCBmeFwb706D0YJalY+0N4Mrfcg0e93N5hqoACYhXyMmm55FYQFVLRhSnuGfXvFEfSf65uGMLgC5uxwQlBAoGAZHwR8plFZ7V3MTKcFFoCXH8KaITVcl3YhGv7WZJIurWgdhsTc2YS4ykBZIoAy9LgImQw8p6Nk4DQtJ8noWkfg1hloOsVk4PX9kFvIj9Hn2kzRv4EAxFZ9uYicDxaNhln2DLGvZfyhTt5KmbXz9k4J3LRt6duvWgVek0DIYQY7CECgYALLtiBOtGAsltrLLlGq/bPrSCqeq2DAUsJLKd2sWVZOpstbXVKGSesGMOyRLbUfb8HArmJx8Nc4ZtH2AxYK8YnXVsVhwbguhRcNzpfzqQvEdHvfwfE03yUxVyyaiYa6X8DUhX/RjfsTImavhb9sRnwOF81Z6Py741lnGhwjAo5ug==";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqcRjeJ1yoEYCmFrQGFhqvUryf1HxVvfn+WRyBMhQzWaO+6EY7Njrr9GQga+ZcmMJX5dRxYwUeeDJFr7kWFZZaKgmCjnmAwzigeUdpTEc1TT6szn1PEEk37IHdh/glv1JZLkAUQLTmCIVW3Rvj7huVpqIPZuAi+RrUd5iyGXJc2BAgH3TE6vWLHDxoRmziDk/Z1f2yjXo5YnsG1ej8jANLS0qQl7BN0V4Gt5kXULYTOYqfv+yMuVTJomPi0M5UcytHGrK82010KgIATi5AMWrpslpAU/s+z8X2vsMgL9shGf8OMP8Om6nlJiNrRP4FrxXRIKA4K29kg9OCri2rKfi2QIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8099/#/repay";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8099/#/repay";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

